package com.xinsoft.controller.basic;

import com.xinsoft.common.Response;
import com.xinsoft.entity.po.SysUserCommonFun;
import com.xinsoft.service.SysUserCommonFunService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/sys/sysUserCommonFun")
public class SysUserCommonFunController {

    @Autowired
    private SysUserCommonFunService sysUserCommonFunService;
    /**
     * 更新
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("/edit")
    public Response<?> edit(@RequestBody List<SysUserCommonFun> sysUserCommonFunList) {
        sysUserCommonFunService.editSysUserCommonFun(sysUserCommonFunList);
        return Response.succeed();
    }

    /**
     * 分页
     */
    @PostMapping("/list")
    public Response<?> pageList() {
        return Response.succeed(sysUserCommonFunService.findList());
    }
}
